package com.cade.agriculturemall;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.widget.TextView;

import com.cade.agriculturemall.base.BaseActivity;
import com.cade.agriculturemall.base.IBasePresenter;
import com.cade.agriculturemall.utils.AssetsUtil;

public class InfoContentActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_info_content);
        setupToolbar(true);
        String tittle = getIntent().getStringExtra("tittle");
        String content = getIntent().getStringExtra("content");
        int type = getIntent().getIntExtra("type", 0);
        setTitle(tittle);
        TextView mTvContent = (TextView) findViewById(R.id.info_content_tv_content);
        if (type == 1) {
            mTvContent.setMovementMethod(ScrollingMovementMethod.getInstance());
            mTvContent.setText(Html.fromHtml(AssetsUtil.stringFromAssetsName(getResources(), content)));
            //使TextView文本可以垂直滚动
            mTvContent.setMovementMethod(ScrollingMovementMethod.getInstance());
        }
        if (type == 2) {
            mTvContent.setText("版权信息" + "\n" + content);
        }

    }

    @Override
    public void setupView() {

    }

    @Override
    public void setupEvent() {

    }

    @Override
    public void setupData() {

    }

    @Override
    public IBasePresenter setupPresenter() {
        return null;
    }
}
